package enums;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

/**
 * 异常信息枚举类
 * @author MI
 */


public enum ExceptionEnum {

    USER_NOT_FOUND(false,4004,"用户查询失败"),
    DATA_EXISTED(false,4005,"重复添加!"),
    TOKEN_OUTED(false,4003,"身份认证过期，请重新登录"),
    ZERO(false,4006,"为0"),
    UPDATE_ERROR(false,4007,"修改失败"),
    INVALID_FILE_TYPE(false,4008,"文件类型无效"),

    UPLOAD_FILE_ERROR(false,4009,"文件上传错误" );

    private boolean flag;
    private int code;
    private String message;

    ExceptionEnum() {
    }

    ExceptionEnum(boolean flag, int code, String message) {
        this.flag = flag;
        this.code = code;
        this.message = message;
    }

    public boolean isFlag() {
        return flag;
    }

    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

}
